package net.sppan.blog.job;

import java.util.Timer;
import java.util.TimerTask;

import net.sppan.blog.store.UserStore;

import com.jfinal.log.Log;

public class ReloadUserJob {
	private static final Log log = Log.getLog(ReloadUserJob.class);

	public static void monitor() {
		Timer timer = new Timer();
		timer.schedule(new ReloadUserJob().new ReloadTask(), 60000, 60000 * 3);

	}

	class ReloadTask extends TimerTask {

		@Override
		public void run() {
			try {
				log.error("reload user start...");
				UserStore.instance.init();
				log.error("reload user end");
			} catch (Exception e) {

			}

		}

	}
}
